(function () {
    var core = ecui,
        util = core.util,
        dom = ecui.dom;
    ecui.util.extend(
        NS.ui,
        {
        }
    );
    var district = mao.info.baseInfo.district.map(function (item) { return { value: item.id, code: item.text }; }),
        genre = mao.info.baseInfo.genre.map(function (item) { return { value: item.id, code: item.text }; });

    district.unshift({ value: '', code: '不限' });
    genre.unshift({ value: '', code: '不限' });

    util.extend(NS.data, {
        artistSortBarConfigs: [
            { type: 'orderBy', name: 'orderBy', typeName: '排序', active: false, show: false, target: 'order_by_filter', data: [] },
            { type: 'status', typeName: '筛选', active: false, show: false, target: 'status_selected', data: {}}
        ],
        artistStatus: {
            playTypeId: { value: '', title: '风格', select: '', items: [] },
            district: { value: '', title: '地区', select: '', items: district },
            genre: { value: '', title: '类型', select: '', items: genre }
        }
    });
    ecui.esr.addRoute('artist', {
        model: [
            'manner@GET /erp-management/sys/play-type/select-list'
        ],
        weight: 2,
        main: 'info_list-artist',
        view: 'list.artist',
        queryUrl: '@FORM /erp-management/data-bank/h5/musician?artist_search_form',
        frame: true,
        CACHE: false,
        onbeforerequest: function (context) {
        },
        onbeforerender: function (context) {
            NS.data.artistSortBarConfigs[0].data = [
                { 'id': '', 'name': '默认降序'},
                { 'id': 'boxOficeDesc', 'name': '票房降序'},
                { 'id': 'boxOfice', 'name': '票房升序'},
                { 'id': 'playNumDesc', 'name': '演出从高到低'},
                { 'id': 'playNum', 'name': '演出从低到高'}
            ];
            NS.data.artistStatus.playTypeId.items = context.manner.map(function (item) { return { value: item.id, code: item.name }; });
            NS.data.artistStatus.playTypeId.items.unshift({ value: '', code: '不限' });

            NS.data.artistSortBarConfigs[1].data = NS.data.artistStatus;
        },
        onafterrender: function (context) {
            ecui.dispatchEvent(ecui.get('artist-list-view'), 'refresh');
        }
    });
}());